package inits

import (
	"driver/cmd/basic/config"
	"fmt"
	"github.com/go-redis/redis/v8"
)

func RedisInit() {
	datare := config.Config.Redis
	Addr := fmt.Sprintf("%s:%d", datare.Host, datare.Port)
	config.Rdb = redis.NewClient(&redis.Options{
		Addr:     Addr,
		Password: datare.Password, // no password set
		DB:       0,               // use default DB
	})
	fmt.Println("redis连接成功")

}
